package com.szt.sy.util.tld;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;

/***
 * tld-日期工具
 * 
 * @author wwy shiqiyue.github.com
 *
 */
public class DateUtils {
	
	private static final String FORMAT_DATE_TIME = "yyyy-MM-dd hh:mm:ss";
	
	private static final String FORMAT_DATE = "yyyy-MM-dd";
	
	public static String getDateTime(Date date) {
		if (date == null) {
			return StringUtils.EMPTY;
		}
		return DateFormatUtils.format(date, FORMAT_DATE_TIME);
	}
	
	public static String getDate(Date date) {
		if (date == null) {
			return StringUtils.EMPTY;
		}
		return DateFormatUtils.format(date, FORMAT_DATE);
	}
	
}
